<%@page import="models.AdsDealModel"%>
<%@page import="java.util.List"%>
<%@page import="java.util.Locale"%>
<%@page import="java.text.NumberFormat"%>
<%@page import="com.google.appengine.api.images.ImagesServiceFactory"%>
<%@page import="com.google.appengine.api.images.ImagesService"%>
<%@page import="com.google.appengine.api.blobstore.BlobKey"%>
<%@page import="models.DealModel"%>
<%@page import="java.util.ArrayList"%>
<%@page import="data.AdsDealData"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
	<div class="sideBox">
		<h3>HN-Hỗ trợ trực tuyến</h3>
		<div class="sideBoxContent">
			<div class="support">
				<span class="number">0946.52.52.72</span><!--  <br /> <span class="number">04.36291319</span> -->
				<br />T2-T6 &nbsp;: 08:30 - 18:00
				<br />Thứ 7 : 08:30 - 12:00
			</div>
			<div class="liveSupport">				
				<div>
					<a href="ymsgr:sendim?onsale365_hn"><img width="125" height="25"
						border="0" alt=""
						src="http://opi.yahoo.com/online?u=onsale365_hn&amp;m=g&amp;t=2"></a>
				</div>
				<div>
					<a href="ymsgr:sendim?onsale365_hcm"><img width="125" height="25"
						border="0" alt=""
						src="http://opi.yahoo.com/online?u=onsale365_hcm&amp;m=g&amp;t=2"></a>
				</div>
				<div>
					<!-- Skype 'My status' button http://www.skype.com/go/skypebuttons -->
					<!--
					Skype 'My status' button
					http://www.skype.com/go/skypebuttons
					-->
					<script type="text/javascript" src="http://download.skype.com/share/skypebuttons/js/skypeCheck.js"></script>
					<a href="skype:onsale365?call"><img src="http://mystatus.skype.com/balloon/onsale365" style="border: none;" width="136" height="50" alt="My status" /></a>

				</div>
			</div>
		</div>
	</div>		
	<%
			ImagesService imagesService = ImagesServiceFactory.getImagesService(); 	
			NumberFormat nf = NumberFormat.getNumberInstance(Locale.GERMAN);
			List<DealModel> listAdRight =  AdsDealData.getListDealByType("right");
			if(listAdRight!=null&&listAdRight.size()>0){			  					
	%>
	<div class="sideBox">
		
		<h3>Deal trong ngày</h3>
		<div class="sideBoxContent">
			<ul class="listDealToday">
			<%
				for(DealModel ad : listAdRight){ 					
					String img = ad.getImageDeal().split(",")[0];	 
					img = img.replaceAll(",", "");
	      			BlobKey blobKey = new BlobKey(img);                        	
            		int less =  (ad.getPrice() - ad.getPriceDiscount());
            		int discount = less*100/ad.getPrice();            	
			%>
				<li>
					<a href="/<%=ad.getDealId()%>/<%=ad.getAlias()%>.html">
						<%=ad.getShortName() %>
					<img src="<%=imagesService.getServingUrl(blobKey) %>"  data-thumb="<%=imagesService.getServingUrl(blobKey) %>"  alt="img" title="img" class="img-full-width" />					
					</a>
					<div class="price clearafter">						
						<span class="left oldPrice"><%=nf.format(ad.getPrice())%> đ</span>
						<span class="left newPrice"><%=nf.format(ad.getPriceDiscount()) %> đ</span>						
					</div>
				</li>
				<%
        				}       				
				%>				
			</ul>
		</div>
	</div>
	<%
			}
	%>
	
